@use '@angular/material' as mat;

@mixin map-color($theme) {
  $config: mat.m2-get-color-config($theme);
  $foreground: map-get($config, foreground);
  $background: map-get($config, background);
  $primary: map-get($config, primary);
  $accent: map-get($config, accent);
  $warn: map-get($config, warn);

  .amap-container {
    box-shadow: 0 4px 20px 2px rgba(0, 0, 0, 0.07);
  }

  .mark-card {
    background-color: mat.m2-get-color-from-palette($background, card);
    box-shadow: 0 4px 20px 2px rgba(0, 0, 0, 0.07);

    .arrow {
      &.top {
        &:after {
          border-top-color: mat.m2-get-color-from-palette(
            $background,
            card
          ) !important;
        }
      }
    }
    &.reverse {
      background-color: mat.m2-get-color-from-palette($primary);
      color: mat.m2-get-color-from-palette($primary, default-contrast);
      box-shadow: 0 4px 20px 2px rgba(0, 0, 0, 0.07);
      .media {
        background-color: mat.m2-get-color-from-palette(
          $primary,
          default-contrast,
          0.5
        );
        img {
          background-color: mat.m2-get-color-from-palette($background, card);
        }
      }

      .sub-title,
      .meta {
        color: mat.m2-get-color-from-palette($primary, default-contrast, 0.75);
      }
      .arrow {
        &.top {
          &:after {
            border-top-color: mat.m2-get-color-from-palette(
              $primary
            ) !important;
          }
        }
      }
    }
  }
  .mark {
    background-color: mat.m2-get-color-from-palette($primary, 0.07);
    // animation: breathe 3s linear infinite;

    &:after {
      background-color: mat.m2-get-color-from-palette($primary);
    }
  }

  @keyframes breathe {
    0% {
      box-shadow: 0 0 0 10px mat.m2-get-color-from-palette($primary, 0.2);
    }
  }
}
